Skip to content

fix: set default smoothing to 0#2535

Merged
graphieros merged 1 commit intomainfrom
default-data-correction-settings
Apr 15, 2026
Merged

fix: set default smoothing to 0#2535
graphieros merged 1 commit intomainfrom
default-data-correction-settings

Conversation

@graphieros
Copy link
Copy Markdown
Contributor

@graphieros graphieros commented Apr 15, 2026

Resolves #2510

Previous default data correction settings had a smoothingTau set to 1, which had the advantage of displaying nicer looking trends, but the disadvantage of correcting intermediate values, which can be perceived as an error by new visitors, when comparing the downloads to the npmjs chart.

This sets the default smootingTau to 0, to show raw data to all users, until they decide to tweak data correction knobs by themselves.

This does not change the impacts of manual corrections, which remain applied by default.

Note

I think we should have these settings made available in the global settings page, because they can be hard to locate (downloads chart modal, inside a details is kind of hidden...). This would require adding a stats section in the settings page, and would be the topic of a separate issue.

@graphieros graphieros linked an issue Apr 15, 2026 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 15, 2026 5:39am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Apr 15, 2026 5:39am
npmx-lunaria Ignored Ignored Apr 15, 2026 5:39am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

The default smoothing parameter for the chart filter has been modified. The DEFAULT_SETTINGS.chartFilter.smoothingTau value has been changed from 1 to 0 in the settings composable, adjusting the initial behaviour of the chart smoothing feature when settings are first initialised or defaults are applied.

Changes

Cohort / File(s) Summary
Settings Default Value
app/composables/useSettings.ts
Updated the default chart filter smoothing tau parameter from 1 to 0, affecting the initial smoothing behaviour for chart visualisations.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: setting the default smoothing parameter to 0.
Linked Issues check ✅ Passed The PR addresses the linked issue #2510 by removing the default smoothing that was causing discrepancies between npmx.dev and npmjs.com charts.
Out of Scope Changes check ✅ Passed The change is tightly scoped to only modifying the default smoothingTau value; no other modifications are present.
Description check ✅ Passed The pull request description directly relates to the changeset, explaining the motivation for changing smoothingTau from 1 to 0 and addressing the linked issue #2510.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch default-data-correction-settings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@graphieros graphieros requested a review from patak-cat April 15, 2026 05:39
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/composables/useSettings.ts`:
- Line 76: The shallow-merge behavior of useLocalStorage with mergeDefaults:true
means the new smoothingTau default won't be applied to existing persisted
settings; add a migration step in the useSettings composable to normalise stored
settings on load (e.g., in the logic that calls useLocalStorage or immediately
after retrieving its value) that performs a deep merge or explicitly sets
chartFilter.smoothingTau to 0 when it is undefined, implementing a small
migrateSettings (or applyDefaultsToStoredSettings) helper to walk nested keys
and preserve existing user values while injecting the new default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 425379e5-ba07-4c41-a8e1-29befc22a71a

📥 Commits

Reviewing files that changed from the base of the PR and between 02ad831 and 6720f3e.

📒 Files selected for processing (1)
  • app/composables/useSettings.ts

Comment thread app/composables/useSettings.ts
@graphieros graphieros added the needs review This PR is waiting for a review from a maintainer label Apr 15, 2026
@graphieros
Copy link
Copy Markdown
Contributor Author

@jycouet
Would also love to have your official blessing on this one :)

Copy link
Copy Markdown
Contributor

@jycouet jycouet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good to me 😁

Copy link
Copy Markdown
Contributor

@patak-cat patak-cat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense to me

@graphieros graphieros added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 0ca1692 Apr 15, 2026
26 checks passed
@graphieros graphieros deleted the default-data-correction-settings branch April 15, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review This PR is waiting for a review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different download graph values

3 participants